package com.lyl.service.impl;

import com.alicp.jetcache.anno.CacheType;
import com.alicp.jetcache.anno.Cached;
import com.lyl.model.WebLog;
import com.lyl.service.TestService;
import org.springframework.stereotype.Service;

/**
 * @author lylbell
 * @date 2021-06-21 18:19
 */
@Service
public class TestServiceImpl implements TestService {

    @Override
    //CacheType.BOTH：本地和redis都保存
    @Cached(name = "com.lyl.service.impl.TestServiceImpl:",key = "#username" ,cacheType = CacheType.BOTH)
    public WebLog get(String username) {
        WebLog webLog = new WebLog();
        webLog.setUsername(username);
        webLog.setResult("ok");
        return webLog;
    }
}
